home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 031a / adg_7_8.zip / MDI.H < prev    next >
C/C++ Source or Header  |  1991-02-21  |  5KB  |  146 lines

  1. /****************************************************************************
  2. Module name: MDI.H
  3. Programmer : Jeffrey M. Richter & Elvira Peretsman.
  4. *****************************************************************************/
  5. #include "dialog.h"
  6.  
  7. extern char   _szAppName[];   // The name of the application.
  8. extern HANDLE _hInstance;     // Data instance of the application.
  9. extern HANDLE _hAccelTable;   // Handle to active Accelerator table.
  10. extern HWND   _hWndMDIClient; // Handle to MDICLIENT window.
  11. extern HWND   _hDlgRibbon;    // Handle to Ribbon modeless dialog box.
  12.  
  13. BOOL FAR PASCAL RegisterFrameWndClass (void);
  14. BOOL FAR PASCAL RegisterSheetWndClass (void);
  15. BOOL FAR PASCAL RegisterChartWndClass (void);
  16. BOOL FAR PASCAL RibbonDlgProc (HWND hDlg, WORD wMsg, WORD wParam, DWORD dwParam);
  17.  
  18.  
  19. #define GETFRAME(hWnd)  ((HWND) (GetParent(GetParent(hWnd))))
  20.  
  21.  
  22. // User-defined Messages processed by Frame Window class.
  23. #define FW_MDICHILDDESTROY    (WM_USER + 0)
  24. #define FW_RESIZEMDICLIENT    (WM_USER + 1)
  25. #define FW_GETSTATBARRECT     (WM_USER + 2)
  26. #define FW_SETMENUHELP        (WM_USER + 3)
  27. #define FW_GETMENUHELP        (WM_USER + 4)
  28. #define FW_DRAWSTATUSDIVIDE   (WM_USER + 5)
  29.  
  30. // User-defined Messages processed by all window classes.
  31. #define AW_PAINTMENUHELP      (WM_USER + 100)
  32.  
  33. // User-defined Messages processed by all MDI Child window classes.
  34. #define AC_PAINTSTATBAR       (WM_USER + 200)
  35.  
  36.  
  37.  
  38.  
  39. // FILE MENU   
  40. #define IDM_FILEOPENSHEET           101
  41. #define IDM_FILEOPENCHART           102
  42. #define IDM_FILESAVE                104
  43. #define IDM_FILESAVEAS              105
  44. #define IDM_FILEPRINT               106
  45. #define IDM_FILEPRINTERSETUP        107
  46. #define IDM_EXIT                    108
  47.  
  48. // EDIT MENU
  49. #define IDM_EDITCUT                 110
  50. #define IDM_EDITCOPY                111
  51. #define IDM_EDITPASTE               112
  52.  
  53. // SHEET MENU
  54. #define IDM_SHEETOPTION             120
  55.  
  56. // CHART MENU
  57. #define IDM_CHARTOPTION             130
  58.  
  59. // OPTIONS MENU
  60. #define IDM_OPTIONSSTATUS           140
  61. #define IDM_OPTIONSRIBBON           141
  62.  
  63. // HELP MENU
  64. #define IDM_HELPINDEX               150
  65. #define IDM_HELPKEYBOARD            151
  66. #define IDM_HELPCOMMANDS            152
  67. #define IDM_HELPPROCEDURES          153
  68. #define IDM_HELPUSINGHELP           154
  69. #define IDM_ABOUT                   155
  70.  
  71. // WINDOW MENU
  72. #define IDM_WINDOWTILEVERT          160
  73. #define IDM_WINDOWTILEHORIZ         161
  74. #define IDM_WINDOWCASCADE           162
  75. #define IDM_WINDOWARRANGEICONS      163
  76. #define IDM_WINDOWCHILD             164
  77.  
  78.  
  79. //*********************** String Table Constants *****************************
  80.  
  81. // String table used to fill the font and the size comboboxes in the Ribbon.
  82. #define IDS_FONT           100
  83. #define IDS_SIZE           200
  84.  
  85. // String table for Frame window's menu.
  86. #define IDS_FRAMEPOPUPID   1000
  87. #define IDS_FRAMEMENUID    2000
  88.  
  89. // String table for Sheet window's menu.
  90. #define IDS_SHEETPOPUPID   3000
  91. #define IDS_SHEETMENUID    4000
  92.  
  93. // String table for Chart window's menu.
  94. #define IDS_CHARTPOPUPID   5000
  95. #define IDS_CHARTMENUID    6000
  96.  
  97. // String table for contents of status bar when no menu is open.
  98. #define IDS_FRAMESTATUSBAR 7000
  99. #define IDS_SHEETSTATUSBAR 7001
  100. #define IDS_CHARTSTATUSBAR 7002
  101.  
  102. // Identifiers to help use string tables for menu help descriptions for 
  103. // menu item s in the Application and MDI Child system menus.
  104. #define IDM_SYSMENUSIZE          0x00  // ((SC_SIZE & 0x0FFF)       >> 4)
  105. #define IDM_SYSMENUMOVE          0x01  // ((SC_MOVE & 0x0FFF)       >> 4)
  106. #define IDM_SYSMENUMINIMIZE      0x02  // ((SC_MINIMIZE & 0x0FFF)   >> 4)
  107. #define IDM_SYSMENUMAXIMIZE      0x03  // ((SC_MAXIMIZE & 0x0FFF)   >> 4)
  108. #define IDM_SYSMENUNEXTWINDOW    0x04  // ((SC_NEXTWINDOW & 0x0FFF) >> 4)
  109. #define IDM_SYSMENUCLOSE         0x06  // ((SC_CLOSE & 0x0FFF)      >> 4)
  110. #define IDM_SYSMENURESTORE       0x12  // ((SC_RESTORE & 0x0FFF)    >> 4)
  111. #define IDM_SYSMENUTASKLIST      0x13  // ((SC_TASKLIST & 0x0FFF)   >> 4)
  112.  
  113.  
  114. void FAR PASCAL ChangeMDIMenu (HWND hWndFrame, HWND hWndClient,
  115.          HMENU hTopLevelMenu, WORD wMenuID);
  116.  
  117. HWND FAR PASCAL CreateMDIChild (LPSTR szClassName, LPSTR szWindowName,
  118.          DWORD dwStyle, short x, short y, short nWidth, short nHeight,
  119.          HWND hWndMDIClient, HANDLE hInstance, LONG lParam);
  120.  
  121.  
  122. //*********** Macros for use by Window and Class Extra Bytes *****************
  123.  
  124. #define offsetof(Struct, Member) \
  125.    ((unsigned int) &(((Struct NEAR *) 0)->Member))
  126.  
  127. #define GETWNDEB(hWnd, Struct, Member) \
  128.    ((sizeof(((Struct FAR *)0)->Member) == sizeof(DWORD)) ? \
  129.       GetWindowLong(hWnd, offsetof(Struct, Member)) : \
  130.       GetWindowWord(hWnd, offsetof(Struct, Member)))
  131.  
  132. #define SETWNDEB(hWnd, Struct, Member, Value) \
  133.    ((sizeof(((Struct FAR *)0)->Member) == sizeof(DWORD)) ? \
  134.       SetWindowLong(hWnd, offsetof(Struct, Member), Value) : \
  135.       SetWindowWord(hWnd, offsetof(Struct, Member), (WORD) Value))
  136.  
  137. #define GETCLSEB(hWnd, Struct, Member) \
  138.    ((sizeof(((Struct FAR *)0)->Member) == sizeof(DWORD)) ? \
  139.       GetClassLong(hWnd, offsetof(Struct, Member)) : \
  140.       GetClassWord(hWnd, offsetof(Struct, Member)))
  141.  
  142. #define SETCLSEB(hWnd, Struct, Member, Value) \
  143.    ((sizeof(((Struct FAR *)0)->Member) == sizeof(DWORD)) ? \
  144.       SetClassLong(hWnd, offsetof(Struct, Member), Value) : \
  145.       SetClassWord(hWnd, offsetof(Struct, Member), (WORD) Value))
  146.